package com.qj.daibei.controller;

import com.qj.daibei.pojo.Education;
import com.qj.daibei.service.EducationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

/**
 * author wml
 * Created on 2021/9/24 15:23
 */
@Controller
public class EducationController {

    @Autowired
    private EducationService educationService;

    /**
     * 查询所有的学历
     * @Author wml
     * @return 返回一个 JSON 格式的学历集合
     */
    @GetMapping("/ajaxGetEducation")
    public ResponseEntity<List<Education>> ajaxGetProvince() {
        List<Education> educationList = this.educationService.queryAllEducation();
        return new ResponseEntity<List<Education>>(educationList, HttpStatus.OK);
    }
}
